const mongoose = require("mongoose");
class Db {
	constructor() {
		this._connect();
	}
	_connect(){
		mongoose.connect("mongodb://127.0.0.1:27017/weibo",{
			serverSelectionTimeoutMs:10000
		}).then(()=>{
			console.log("连接数据库成功");
		}).catch(()=>{
			console.log("连接数据库失败");
		})
	}
}
new Db();